const express = require('express')
const router = express.Router()
const teacherController = require('../controller/teacher')
const expressJoi = require('@escook/express-joi')
const { reg_add_teacher } = require('../validator/teacher')

// 获取老师列表
router.get('/getTeacherList', teacherController.getTeacherList)
//获取误删教师列表
router.get('/getRecoveryList', teacherController.getRecoveryList)
// 恢复教师
router.put('/recoverTeacher/:id', teacherController.recoverTeacher)
// 添加老师
router.post('/addTeacher', expressJoi(reg_add_teacher), teacherController.addTeacher)
// 修改老师
router.post('/editTeacher', expressJoi(reg_add_teacher), teacherController.editTeacher)
// 删除老师
router.delete('/deleteTeacher/:id', teacherController.deleteTeacher)
// 彻底删除教师
router.delete('/deleteTeacherForever/:id', teacherController.deleteTeacherForever)

module.exports = router
